<template>
	<view>
		<view class="main-box">
			<ul>
				<li v-for='(item,index) in lengths' :key='index'>{{index}}</li>
				<li v-if='flag'>加载更多</li>
				<uni-load-more status="more" showIcon></uni-load-more>
			</ul>
		</view>
	</view>
</template>
<script>
	import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue"
	export default {
		data() {
			return {
				lengths:20,
				flag:false
			}
		},
		methods: {
			
		},
		components:{
			uniLoadMore
		},
		computed:{
			// flag(){
			// 	if
			// }
		},
		async onReachBottom(){
			this.flag = true
			await setTimeout(()=> {
				// if(this.lengths.length<100){
					this.lengths +=20
				// }
				this.flag = false
			},1000)
			// console.log('cs');
		}
	}
</script>

<style>
.main-box {
	width: 100%;
	/* height: 2000rpx; */
	background-color: pink;
	
}
.main-box li {
	height: 100rpx;
	width: 100%;
	border:1px solid #ccc;
}
</style>
